OpenCores

Overview

Pepelatz zero edition is my first project on Verilog.
On this page i shall place my plans about it.
Please, comment it.

Instruction set

Num

Mnemonic

Comment

00

add

01

sub

02

and

03

or

04

xor

05

shr

06

shl

07

drop

SP--;

08

inc

09

dec

0A

not

0B

svap

S0

0C

rot

S0

0D

store

Save value to memory. *Does not SP--!!!

0E

setcall

Push value from arithmetic stack to call stack.*

0F

dropcall

Drops call stack.*

10

const

Loads a constant from ITh.

11

load

Loads [S0] from memory.*

12

getcall

Gets value from call stack. Does not drop call stack!

13

dup

Duplicates S0.

14

dupd

Duplicates S1 (to stack top).

15

isover

Overflow control.

16

isneg

Negate control.

17

nop

18

loop

Starts current command from beginning.

19

loop1

Loads an operand and starts current command from beginning.

1A

skip

Goes to the next command.

1B

call

Push PC into call stack and go to address

1C

if

if S0=0 then jmp

1D

jump

PC=S0

1E

loopz

If C[0]!=0, dec C[0] and starts current command from beginning.

1F

ifloop

If C[0]!=0, dec C[0] and jmp.

Warring I. PC is a pointer to the next command, not instruction. Jump and call is not jumping. Jumping will happen after the end of current instruction or after skip command.

Warring II. After changing PC, operands will be read from the new address!

Note I. After changing PC, ITh will be overwritten.